3.239 \(\int \cos (a+b x) \cos ^2(c+d x) \, dx\)

Optimal. Leaf size=62 \[ \frac{\sin (a+x (b-2 d)-2 c)}{4 (b-2 d)}+\frac{\sin (a+x (b+2 d)+2 c)}{4 (b+2 d)}+\frac{\sin (a+b x)}{2 b} \]

[Out]

Sin[a + b*x]/(2*b) + Sin[a - 2*c + (b - 2*d)*x]/(4*(b - 2*d)) + Sin[a + 2*c + (b + 2*d)*x]/(4*(b + 2*d))

________________________________________________________________________________________

Rubi [A]  time = 0.0454893, antiderivative size = 62, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 2, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.133, Rules used = {4570, 2637} \[ \frac{\sin (a+x (b-2 d)-2 c)}{4 (b-2 d)}+\frac{\sin (a+x (b+2 d)+2 c)}{4 (b+2 d)}+\frac{\sin (a+b x)}{2 b} \]

Antiderivative was successfully verified.

[In]

Int[Cos[a + b*x]*Cos[c + d*x]^2,x]

[Out]

Sin[a + b*x]/(2*b) + Sin[a - 2*c + (b - 2*d)*x]/(4*(b - 2*d)) + Sin[a + 2*c + (b + 2*d)*x]/(4*(b + 2*d))

Rule 4570

Int[Cos[v_]^(p_.)*Cos[w_]^(q_.), x_Symbol] :> Int[ExpandTrigReduce[Cos[v]^p*Cos[w]^q, x], x] /; ((PolynomialQ[
v, x] && PolynomialQ[w, x]) || (BinomialQ[{v, w}, x] && IndependentQ[Cancel[v/w], x])) && IGtQ[p, 0] && IGtQ[q
, 0]

Rule 2637

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \cos (a+b x) \cos ^2(c+d x) \, dx &=\int \left (\frac{1}{2} \cos (a+b x)+\frac{1}{4} \cos (a-2 c+(b-2 d) x)+\frac{1}{4} \cos (a+2 c+(b+2 d) x)\right ) \, dx\\ &=\frac{1}{4} \int \cos (a-2 c+(b-2 d) x) \, dx+\frac{1}{4} \int \cos (a+2 c+(b+2 d) x) \, dx+\frac{1}{2} \int \cos (a+b x) \, dx\\ &=\frac{\sin (a+b x)}{2 b}+\frac{\sin (a-2 c+(b-2 d) x)}{4 (b-2 d)}+\frac{\sin (a+2 c+(b+2 d) x)}{4 (b+2 d)}\\ \end{align*}

Mathematica [A]  time = 0.713151, size = 69, normalized size = 1.11 \[ \frac{1}{4} \left (\frac{\sin (a+b x-2 c-2 d x)}{b-2 d}+\frac{\sin (a+b x+2 c+2 d x)}{b+2 d}+\frac{2 \sin (a) \cos (b x)}{b}+\frac{2 \cos (a) \sin (b x)}{b}\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[a + b*x]*Cos[c + d*x]^2,x]

[Out]

((2*Cos[b*x]*Sin[a])/b + (2*Cos[a]*Sin[b*x])/b + Sin[a - 2*c + b*x - 2*d*x]/(b - 2*d) + Sin[a + 2*c + b*x + 2*
d*x]/(b + 2*d))/4

________________________________________________________________________________________

Maple [A]  time = 0.023, size = 57, normalized size = 0.9 \begin{align*}{\frac{\sin \left ( bx+a \right ) }{2\,b}}+{\frac{\sin \left ( a-2\,c+ \left ( b-2\,d \right ) x \right ) }{4\,b-8\,d}}+{\frac{\sin \left ( a+2\,c+ \left ( b+2\,d \right ) x \right ) }{4\,b+8\,d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(b*x+a)*cos(d*x+c)^2,x)

[Out]

1/2*sin(b*x+a)/b+1/4*sin(a-2*c+(b-2*d)*x)/(b-2*d)+1/4*sin(a+2*c+(b+2*d)*x)/(b+2*d)

________________________________________________________________________________________

Maxima [B]  time = 1.24765, size = 562, normalized size = 9.06 \begin{align*} -\frac{{\left (b^{2} \sin \left (2 \, c\right ) - 2 \, b d \sin \left (2 \, c\right )\right )} \cos \left ({\left (b + 2 \, d\right )} x + a + 4 \, c\right ) -{\left (b^{2} \sin \left (2 \, c\right ) - 2 \, b d \sin \left (2 \, c\right )\right )} \cos \left ({\left (b + 2 \, d\right )} x + a\right ) -{\left (b^{2} \sin \left (2 \, c\right ) + 2 \, b d \sin \left (2 \, c\right )\right )} \cos \left (-{\left (b - 2 \, d\right )} x - a + 4 \, c\right ) +{\left (b^{2} \sin \left (2 \, c\right ) + 2 \, b d \sin \left (2 \, c\right )\right )} \cos \left (-{\left (b - 2 \, d\right )} x - a\right ) + 2 \,{\left (b^{2} \sin \left (2 \, c\right ) - 4 \, d^{2} \sin \left (2 \, c\right )\right )} \cos \left (b x + a + 2 \, c\right ) - 2 \,{\left (b^{2} \sin \left (2 \, c\right ) - 4 \, d^{2} \sin \left (2 \, c\right )\right )} \cos \left (b x + a - 2 \, c\right ) -{\left (b^{2} \cos \left (2 \, c\right ) - 2 \, b d \cos \left (2 \, c\right )\right )} \sin \left ({\left (b + 2 \, d\right )} x + a + 4 \, c\right ) -{\left (b^{2} \cos \left (2 \, c\right ) - 2 \, b d \cos \left (2 \, c\right )\right )} \sin \left ({\left (b + 2 \, d\right )} x + a\right ) +{\left (b^{2} \cos \left (2 \, c\right ) + 2 \, b d \cos \left (2 \, c\right )\right )} \sin \left (-{\left (b - 2 \, d\right )} x - a + 4 \, c\right ) +{\left (b^{2} \cos \left (2 \, c\right ) + 2 \, b d \cos \left (2 \, c\right )\right )} \sin \left (-{\left (b - 2 \, d\right )} x - a\right ) - 2 \,{\left (b^{2} \cos \left (2 \, c\right ) - 4 \, d^{2} \cos \left (2 \, c\right )\right )} \sin \left (b x + a + 2 \, c\right ) - 2 \,{\left (b^{2} \cos \left (2 \, c\right ) - 4 \, d^{2} \cos \left (2 \, c\right )\right )} \sin \left (b x + a - 2 \, c\right )}{8 \,{\left (b^{3} \cos \left (2 \, c\right )^{2} + b^{3} \sin \left (2 \, c\right )^{2} - 4 \,{\left (b \cos \left (2 \, c\right )^{2} + b \sin \left (2 \, c\right )^{2}\right )} d^{2}\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)*cos(d*x+c)^2,x, algorithm="maxima")

[Out]

-1/8*((b^2*sin(2*c) - 2*b*d*sin(2*c))*cos((b + 2*d)*x + a + 4*c) - (b^2*sin(2*c) - 2*b*d*sin(2*c))*cos((b + 2*
d)*x + a) - (b^2*sin(2*c) + 2*b*d*sin(2*c))*cos(-(b - 2*d)*x - a + 4*c) + (b^2*sin(2*c) + 2*b*d*sin(2*c))*cos(
-(b - 2*d)*x - a) + 2*(b^2*sin(2*c) - 4*d^2*sin(2*c))*cos(b*x + a + 2*c) - 2*(b^2*sin(2*c) - 4*d^2*sin(2*c))*c
os(b*x + a - 2*c) - (b^2*cos(2*c) - 2*b*d*cos(2*c))*sin((b + 2*d)*x + a + 4*c) - (b^2*cos(2*c) - 2*b*d*cos(2*c
))*sin((b + 2*d)*x + a) + (b^2*cos(2*c) + 2*b*d*cos(2*c))*sin(-(b - 2*d)*x - a + 4*c) + (b^2*cos(2*c) + 2*b*d*
cos(2*c))*sin(-(b - 2*d)*x - a) - 2*(b^2*cos(2*c) - 4*d^2*cos(2*c))*sin(b*x + a + 2*c) - 2*(b^2*cos(2*c) - 4*d
^2*cos(2*c))*sin(b*x + a - 2*c))/(b^3*cos(2*c)^2 + b^3*sin(2*c)^2 - 4*(b*cos(2*c)^2 + b*sin(2*c)^2)*d^2)

________________________________________________________________________________________

Fricas [A]  time = 0.504163, size = 147, normalized size = 2.37 \begin{align*} -\frac{2 \, b d \cos \left (b x + a\right ) \cos \left (d x + c\right ) \sin \left (d x + c\right ) -{\left (b^{2} \cos \left (d x + c\right )^{2} - 2 \, d^{2}\right )} \sin \left (b x + a\right )}{b^{3} - 4 \, b d^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)*cos(d*x+c)^2,x, algorithm="fricas")

[Out]

-(2*b*d*cos(b*x + a)*cos(d*x + c)*sin(d*x + c) - (b^2*cos(d*x + c)^2 - 2*d^2)*sin(b*x + a))/(b^3 - 4*b*d^2)

________________________________________________________________________________________

Sympy [A]  time = 12.6248, size = 401, normalized size = 6.47 \begin{align*} \begin{cases} x \cos{\left (a \right )} \cos ^{2}{\left (c \right )} & \text{for}\: b = 0 \wedge d = 0 \\\left (\frac{x \sin ^{2}{\left (c + d x \right )}}{2} + \frac{x \cos ^{2}{\left (c + d x \right )}}{2} + \frac{\sin{\left (c + d x \right )} \cos{\left (c + d x \right )}}{2 d}\right ) \cos{\left (a \right )} & \text{for}\: b = 0 \\- \frac{x \sin{\left (a - 2 d x \right )} \sin{\left (c + d x \right )} \cos{\left (c + d x \right )}}{2} - \frac{x \sin ^{2}{\left (c + d x \right )} \cos{\left (a - 2 d x \right )}}{4} + \frac{x \cos{\left (a - 2 d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} - \frac{\sin{\left (a - 2 d x \right )} \cos ^{2}{\left (c + d x \right )}}{2 d} - \frac{\sin{\left (c + d x \right )} \cos{\left (a - 2 d x \right )} \cos{\left (c + d x \right )}}{4 d} & \text{for}\: b = - 2 d \\\frac{x \sin{\left (a + 2 d x \right )} \sin{\left (c + d x \right )} \cos{\left (c + d x \right )}}{2} - \frac{x \sin ^{2}{\left (c + d x \right )} \cos{\left (a + 2 d x \right )}}{4} + \frac{x \cos{\left (a + 2 d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac{\sin{\left (a + 2 d x \right )} \sin ^{2}{\left (c + d x \right )}}{8 d} + \frac{3 \sin{\left (a + 2 d x \right )} \cos ^{2}{\left (c + d x \right )}}{8 d} & \text{for}\: b = 2 d \\\frac{b^{2} \sin{\left (a + b x \right )} \cos ^{2}{\left (c + d x \right )}}{b^{3} - 4 b d^{2}} - \frac{2 b d \sin{\left (c + d x \right )} \cos{\left (a + b x \right )} \cos{\left (c + d x \right )}}{b^{3} - 4 b d^{2}} - \frac{2 d^{2} \sin{\left (a + b x \right )} \sin ^{2}{\left (c + d x \right )}}{b^{3} - 4 b d^{2}} - \frac{2 d^{2} \sin{\left (a + b x \right )} \cos ^{2}{\left (c + d x \right )}}{b^{3} - 4 b d^{2}} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)*cos(d*x+c)**2,x)

[Out]

Piecewise((x*cos(a)*cos(c)**2, Eq(b, 0) & Eq(d, 0)), ((x*sin(c + d*x)**2/2 + x*cos(c + d*x)**2/2 + sin(c + d*x
)*cos(c + d*x)/(2*d))*cos(a), Eq(b, 0)), (-x*sin(a - 2*d*x)*sin(c + d*x)*cos(c + d*x)/2 - x*sin(c + d*x)**2*co
s(a - 2*d*x)/4 + x*cos(a - 2*d*x)*cos(c + d*x)**2/4 - sin(a - 2*d*x)*cos(c + d*x)**2/(2*d) - sin(c + d*x)*cos(
a - 2*d*x)*cos(c + d*x)/(4*d), Eq(b, -2*d)), (x*sin(a + 2*d*x)*sin(c + d*x)*cos(c + d*x)/2 - x*sin(c + d*x)**2
*cos(a + 2*d*x)/4 + x*cos(a + 2*d*x)*cos(c + d*x)**2/4 + sin(a + 2*d*x)*sin(c + d*x)**2/(8*d) + 3*sin(a + 2*d*
x)*cos(c + d*x)**2/(8*d), Eq(b, 2*d)), (b**2*sin(a + b*x)*cos(c + d*x)**2/(b**3 - 4*b*d**2) - 2*b*d*sin(c + d*
x)*cos(a + b*x)*cos(c + d*x)/(b**3 - 4*b*d**2) - 2*d**2*sin(a + b*x)*sin(c + d*x)**2/(b**3 - 4*b*d**2) - 2*d**
2*sin(a + b*x)*cos(c + d*x)**2/(b**3 - 4*b*d**2), True))

________________________________________________________________________________________

Giac [A]  time = 1.11932, size = 76, normalized size = 1.23 \begin{align*} \frac{\sin \left (b x + 2 \, d x + a + 2 \, c\right )}{4 \,{\left (b + 2 \, d\right )}} + \frac{\sin \left (b x - 2 \, d x + a - 2 \, c\right )}{4 \,{\left (b - 2 \, d\right )}} + \frac{\sin \left (b x + a\right )}{2 \, b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)*cos(d*x+c)^2,x, algorithm="giac")

[Out]

1/4*sin(b*x + 2*d*x + a + 2*c)/(b + 2*d) + 1/4*sin(b*x - 2*d*x + a - 2*c)/(b - 2*d) + 1/2*sin(b*x + a)/b